<template>
  <van-overlay :show="isShow">
    <div class="wrapper">
      <div class="content">
        <span class="title">恭喜获得</span>
        <span class="amount">{{ amount }}</span>
        <span class="unit">元</span>
      </div>
      <van-icon name="close" class="close_icon" @click="close" />
    </div>
  </van-overlay>
</template>

<script>
export default {
  name: "RecordMask",
  props: ["onClose"],
  data() {
    return {
      isShow: false,
      amount: 0,
    };
  },

  mounted() {},

  methods: {
    show(amount = 0) {
      this.isShow = true;
      this.amount = amount;
    },
    close() {
      this.isShow = false;
      this.onClose();
    },
  },
};
</script>

<style lang="scss" scoped>
.wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background-image: url("../assets/reward.jpg");
  background-repeat: no-repeat;
  background-size: 300px;
  background-position: center;
  .content {
    transform: translateY(15%);
    display: flex;

    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 10px;
  }
  .close_icon {
    position: absolute;
    top: 10px;
    right: 10px;
    color: rgb(255, 255, 255);
    font-size: 40px;
  }
}
</style>
